<template>
  <el-form :model="form" ref="lockForm" label-width="80px">
    <el-form-item label="锁屏密码" prop="passwd" :rules="[{ required: true, message: '锁屏密码不能为空' }]">
      <el-input v-model="form.passwd" placeholder="请输入锁屏密码" />
    </el-form-item>
  </el-form>
</template>

<script>
export default {
  name: 'LockSystem',
  data: () => ({ form: { passwd: '' } }),
  methods: {
    handleSetLock() {
      this.$refs.lockForm.validate(valid => {
        if (!valid) return
        this.$emit('lock', this.form.passwd)
      })
    }
  }
}
</script>
